using System;
using System.Text;
using System.Reflection;
using System.ServiceModel;
using System.Collections.Generic;
using System.Runtime.Serialization;
using TDS = Tridion.ContentManager.Interop.TDS;
using TDSDefines = Tridion.ContentManager.Interop.TDSDefines;



#pragma warning disable 649
namespace Tridion.Gateway
{
	[DataContract]
	public class User:Facade
	{
        internal User(TDS.User User, bool ShallowCopy)
            : base(typeof(TDS._User), User, ShallowCopy)
		{
		}

		[DataMember(Name="ItemType")]
		private TDSDefines.ItemType itemtype;
		public TDSDefines.ItemType ItemType
		{
			 get { return itemtype; }
		}


		[DataMember(Name="ID")]
		private String id;
		public String ID
		{
			 get { return id; }
		}


		[DataMember(Name="Name")]
		private String name;
		public String Name
		{
			 get { return name; }
			 set { name = value; }
		}


		[DataMember(Name="Description")]
		private String description;
		public String Description
		{
			 get { return description; }
			 set { description = value; }
		}


		[DataMember(Name="Enabled")]
		private Boolean enabled;
		public Boolean Enabled
		{
			 get { return enabled; }
			 set { enabled = value; }
		}


		[DataMember(Name="IsPredefined")]
		private Boolean ispredefined;
		public Boolean IsPredefined
		{
			 get { return ispredefined; }
		}


        //TODO:Fix
        //[DataMember(Name="GroupMemberships")]
        //private GroupMemberships groupmemberships;
        //public GroupMemberships GroupMemberships
        //{
        //     get { return groupmemberships; }
        //     set { groupmemberships = value; }
        //}


		[DataMember(Name="LangID")]
		private Int32 langid;
		public Int32 LangID
		{
			 get { return langid; }
			 set { langid = value; }
		}


        //TODO:Fix TDSDefines.TDSPrivileges 
        [IgnoreReflectedField]
        [DataMember(Name = "Privileges")]
        private Int32 privileges;
        public Int32 Privileges
        {
            get { return privileges; }
            set { privileges = value; }
        }


		[DataMember(Name="LocaleID")]
		private Int32 localeid;
		public Int32 LocaleID
		{
			 get { return localeid; }
			 set { localeid = value; }
		}


        protected override void Initialize(FieldInfo field, PropertyInfo property, Object value)
        {
            switch (field.Name)
            {
                case "privileges":
                    object o = property.GetValue(value, null);
                    privileges = (int)((TDSDefines.TDSPrivileges)o);
                    break;
            }
        }

        //protected override void Initialize(FieldInfo field, Object value)
        //{
        //    switch (field.Name)
        //    {
        //        case "privileges":
        //            privileges = (int)((TDSDefines.TDSPrivileges)value);
        //            break;
        //    }
        //}
	}
}

/*
			System.String GetXML(Tridion.ContentManager.Interop.TDSDefines.XMLReadFilter)
			Void UpdateXML(System.String)
			Void Save(Boolean)
			Void Delete()
			Void SetPermissions(System.String, System.String)
			System.String GetListGroupMemberships(Tridion.ContentManager.Interop.TDSDefines.ListColumnFilter, Tridion.ContentManager.Interop.TDS.ListRowFilter)
*/
